package org.bambrikii.photobank.web.payment.beans;

import java.util.List;

import org.bambrikii.photobank.business.managers.CurrencyManager;
import org.bambrikii.photobank.business.managers.FileDimensionManager;
import org.bambrikii.photobank.model.FileDimension;
import org.bambrikii.site.base.business.managers.core.ManagerException;
import org.bambrikii.site.base.model.Pager;
import org.bambrikii.site.base.payment.model.Currency;
import org.bambrikii.site.base.struts2.core.crud.BaseCrudBean;

public class FilePriceBean extends BaseCrudBean<FileDimension, FileDimensionManager> {

	private FileDimensionManager fileDimensionManager;
	private CurrencyManager currencyManager;

	public FilePriceBean(FileDimensionManager fileDimensionManager, CurrencyManager currencyManager) {
		this.fileDimensionManager = fileDimensionManager;
		this.currencyManager = currencyManager;
	}

	@Override
	protected FileDimensionManager getManager() throws ManagerException {
		return fileDimensionManager;
	}

	public Pager<FileDimension> getDimensions(String sortOrder, Integer requestedPage) throws ManagerException {
		return fileDimensionManager.getPager(sortOrder, requestedPage);
	}

	public List<Currency> getAllActiveCurrencies() throws ManagerException {
		return currencyManager.getCurrencies(true);
	}

	public Currency getCurrencyById(Integer id) throws ManagerException {
		return currencyManager.getCurrencyById(id);
	}
}
